package com.cn.springcloudwechat.service.personalcenter.service;

import com.cn.springcloudwechat.common.mybatis.Page;
import com.cn.springcloudwechat.model.YmUser;
import com.cn.springcloudwechat.model.YmUserPoint;
import com.cn.springcloudwechat.model.weixin.user.WxFollower;
import org.apache.ibatis.annotations.Param;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public interface YmUserService {

    /**
     * 根据用户userId查询
     * @param userId
     * @return
     */
    YmUser selectByPrimaryKey(Long userId);
    /**
     * 根据openid查询用户
     * @param openid
     * @return
     */
    YmUser getUserByOpenId(String openid);

    /**
     * 根据手机号查询用户
     * @param phone
     * @return
     */
    YmUser getUserByPhone(String phone);

    /**
     * 将微信用户信息插入用户表
     * @param wxUser
     * @return
     */
    Integer insertUserByWx(WxFollower wxUser, String password, String userPhone);

    /**
     * 修改用户信息
     * @param ymUser
     * @return
     */
    Integer updateUser(YmUser ymUser);


    /**
     * 获取所有用户
     * @return
     */
    Page<YmUser> getUserList(YmUser ymUser,Page<YmUser> page);

    /**
     * 启用禁用用户
     * @param userId
     */
    void updateUserState(Integer state,String[] userId);

    /**
     * 豆豆明细
     * @param userId
     * @return
     */
    Page<YmUserPoint> getPoint(Long userId,Page<YmUserPoint> page);


}
